Programming Concepts in C++ by Robert Burns

Programming Concepts in C++ by Robert Burns

Author:Robert Burns [Burns, Robert]
Language: eng
Format: epub, pdf
ISBN: 9781499044812
Publisher: Xlibris US
Published: 2014-07-21T21:00:00+00:00


7.3.4 Classic Min/Max Loop

As it was presented in the previous chapter, a classic min/max problem is finding the largest and smallest among three values. In this variation we find the largest and smallest among an unlimited number of values, using an event-controlled loop. The loop is controlled using the “sentinel method” – when the user enters a certain value outside of the expected range of values, it is a signal to exit the loop. As in the example from the previous chapter, we use test scores whose values are expected to be in the range of 0 to 100. Here are some code blocks that show how this is done:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.